  <?php get_header();?>
  
  <script type="text/javascript" src="<?php echo get_template_directory_uri();?>/js/portfolio-video.js"></script>        
    
    <div id="fullwidth">			
      <h1><?php echo __('Portfolio','centita');?></h1><!-- Page Title Here -->
      						
      <div class="clr"></div>
      	
      <?php if (have_posts()) : ?>
      <?php while (have_posts()) : the_post();?>
      <?php 
      $pf_link = get_post_meta($post->ID, '_portfolio_link', true );
      $portfolio_url = get_post_meta($post->ID,"_portfolio_url",true);
      ?>
      <div class="pf-boximg">
        <?php if ($pf_link) { ?>
            <?php
            if (is_youtube($pf_link)) { ?>
              <div class="portfolio_movie_container"><a href="<?php echo $pf_link;?>"  rel="youtube"></a></div>
            <?php
            } else if (is_vimeo($pf_link)) { ?>
              <div class="portfolio_movie_container"><a href="<?php echo $pf_link;?>"  rel="vimeo"></a></div>    
            <?php  
            } else if (is_quicktime($pf_link)) { 
              ?>
              <div class="portfolio_movie_container"><a href="<?php echo $pf_link;?>"  rel="quicktime"></a></div>
              <?php
            } else { ?>
              <div class="portfolio_movie_container"><a href="<?php echo $pf_link;?>"  rel="flash"></a></div>
              <?php
            }
            ?>
          <?php } else { ?>
          <?php if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {?>
            <img src="<?php echo get_template_directory_uri();?>/timthumb.php?src=<?php echo thumb_url();?>&amp;h=320&amp;w=600&amp;zc=1" alt="" />
          <?php } ?>       
        <?php } ?>  
      </div>
      <div class="pf-boxdesc">
          <?php 
          $pf_link = get_post_meta($post->ID, '_portfolio_link', true );
          $portfolio_url = get_post_meta($post->ID,"_portfolio_url",true);
          ?>
          <h2><?php the_title();?></h2>
          <?php the_content();?>
          <div class="clr"></div><br />
          <?php if ($portfolio_url !="") { ?>
          <a href="<?php echo $portfolio_url;?>" class="button_readmore"><?php echo __('Visit Site','centita');?> &raquo;</a>
          <?php } ?>
      </div>
      <?php endwhile;?>
	    <?php endif;?>							
		</div><!-- end of main -->
		<?php get_footer();?>